import Vue from "vue";
import Router from "vue-router";
import Home from "./views/Home";
import Detail from "./views/Detail";
import Layout from "./views/Layout";
import Edit from "./views/Edit";

Vue.use(Router);

export default new Router({
  routes: [
    {
      path: "/",
      redirect: "/home"
    },
    {
      path: "/home",
      component: Layout,
      children: [
        {
          path: "/",
          name: "home",
          component: Home,
          meta: {
            add: true,
            title: "最近",
            tabbar: true
          }
        }
      ]
    },
    {
      path: "/detail",
      component: Layout,
      children: [
        {
          path: "/",
          name: "detail",
          component: Detail,
          meta: {
            back: true,
            edit: true,
            title: "详情"
          }
        }
      ]
    },
    {
      path: "/edit",
      component: Layout,
      children: [
        {
          path: "/",
          name: "edit",
          component: Edit,
          meta: {
            back: true,
            complete: true,
            title: "编辑"
          }
        }
      ]
    }
  ]
});
